using Coderoom.ScrumPlanner.Web;
using Coderoom.ScrumPlanner.Web.Controllers;
using Xunit;

namespace Coderoom.ScrumPlanner.Tests.Unit.MvcTests
{
	public class StructureMapControllerFactoryTests
	{
		private readonly StructureMapControllerFactory _factory;

		public StructureMapControllerFactoryTests()
		{
			// initialise container
			MvcApplication.ConfigureStructureMapContainer();

			_factory = new StructureMapControllerFactory();
		}

		[Fact]
		public void CreateController_Returns_Correct_Controller()
		{
			// act
			var controller = _factory.CreateController<HomeController>();

			// assert
			Assert.NotNull(controller);
			Assert.IsType<HomeController>(controller);
		}
	}
}